﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucReportDocumentos.ascx.cs"
    Inherits="wRegPadron.frmOpciones.ucReportDocumentos" %>
<%@ Register Assembly="BasicFrame.WebControls.BasicDatePicker" Namespace="BasicFrame.WebControls"
    TagPrefix="BDP" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<script type="text/javascript">
    function switchViews(obj, row) {
        var div = document.getElementById(obj);
        var img = document.getElementById('img' + obj);

        if (div.style.display == "none") {
            div.style.display = "inline";
            if (row == 'alt') {
                img.src = "Imagenes/bullet_arrow_down.png"; mce_src = "Imagenes/bullet_arrow_down.png";
            }
            else {

                img.src = "Imagenes/bullet_arrow_down.png"; mce_src = "Imagenes/bullet_arrow_down.png";


            }
            img.alt = "";
        }
        else {
            div.style.display = "none";
            if (row == 'alt') {
                img.src = "Imagenes/bullet_arrow_right.png"; mce_src = "Imagenes/bullet_arrow_right.png";
            }
            else {
                img.src = "Imagenes/bullet_arrow_right.png"; mce_src = "Imagenes/bullet_arrow_right.png";
            }
            img.alt = "";
        }
    }
</script>
<asp:UpdatePanel runat="server" ID="upAgendaMunicipal">
    <Triggers>
        <asp:PostBackTrigger ControlID="btnAceptar" />
    </Triggers>
    <ContentTemplate>
        <table width="100%">
            <tr>
                <td align="center">
                    <table width="95%">
                        <tr>
                            <td class="tdSubTituloVentana" colspan="2" valign="top" align="left" style="padding-left: 10px;">
                                <fieldset>
                                    <legend>
                                        <h3>
                                            <asp:Label runat="server" ID="lblTitulo"></asp:Label>
                                            <p>
                                                <small>
                                                    <asp:Label runat="server" ID="lblDescripcion"></asp:Label></small></p>
                                        </h3>
                                    </legend>
                                </fieldset>
                            </td>
                        </tr>
                        <tr>
                            <td align="center">
                                <table width="70%">
                                    <tr>
                                        <td align="left" class="text-info">
                                            Fecha inicio:
                                        </td>
                                        <td align="center">
                                            <BDP:BDPLite ID="bdpFecInicio" runat="server">
                                            </BDP:BDPLite>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" class="text-info">
                                            Fecha fin:
                                        </td>
                                        <td align="center">
                                            <BDP:BDPLite ID="bdpFecFin" runat="server">
                                            </BDP:BDPLite>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <br />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" class="text-info">
                                            Area:
                                        </td>
                                        <td align="center">
                                            <asp:TextBox runat="server" ID="txtArea" CssClass="tdCampoValorInput" Width="350"></asp:TextBox>
                                            <asp:AutoCompleteExtender ID="txtArea_AutoCompleteExtender" runat="server" ServiceMethod="InformacionAutoComp"
                                                ServicePath="../AutoComplete.asmx" MinimumPrefixLength="1" CompletionSetCount="12"
                                                CompletionInterval="1000" TargetControlID="txtArea">
                                            </asp:AutoCompleteExtender>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="center">
                                            <asp:Button runat="server" ID="btnAceptar" Text="Aceptar" CssClass="btn"
                                                OnClick="btnAceptar_Click" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <br />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="center">
                                            <asp:Label runat="server" ID="lblErrorBusqueda" CssClass="text-error"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <br />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td align="center">
                                <asp:GridView runat="server" ID="gvAreaDocu" AutoGenerateColumns="False" OnRowDataBound="gvAreaDocu_RowDataBound"
                                    BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
                                    CellPadding="3" AllowPaging="true" PageSize="10" DataKeyNames="Key" Width="95%"
                                    OnPageIndexChanging="gvAreaDocu_PageIndexChanging">
                                    <FooterStyle BackColor="White" ForeColor="#000066" />
                                    <HeaderStyle BackColor="#d3d3d1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                    <RowStyle ForeColor="#000066" />
                                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                                    <Columns>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <a href="javascript:switchViews('div<%# Eval("Key") %>', 'one');">
                                                    <img id="imgdiv<%# Eval("Key") %>" alt="Mostrar/Ocultar documentos" border="0" src="Imagenes/bullet_arrow_right.png"
                                                        width="25" height="25" />
                                                </a>
                                            </ItemTemplate>
                                            <AlternatingItemTemplate>
                                                <a href="javascript:switchViews('div<%# Eval("Key") %>', 'alt');">
                                                    <img id="imgdiv<%# Eval("Key") %>" alt="Mostrar/Ocultar documentos" border="0" src="Imagenes/bullet_arrow_right.png"
                                                        width="25" height="25" />
                                                </a>
                                            </AlternatingItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="Fecha" HeaderText="Fecha de creación" />
                                        <asp:BoundField DataField="Area" HeaderText="Área" Visible="false" />
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                </td></tr>
                                                <tr>
                                                    <td colspan="100%">
                                                        <div id="div<%# Eval("Key") %>" style="display: none; position: relative; left: 25px;">
                                                            <asp:GridView ID="gvDocumentos" runat="server" Width="95%" AutoGenerateColumns="false"
                                                                DataKeyNames="IdDocumentos" EmptyDataText="No hay documentos" OnRowDataBound="gvDocumentos_RowDataBound">
                                                                <FooterStyle BackColor="White" ForeColor="#000066" />
                                                                <HeaderStyle BackColor="#cad8a5" Font-Bold="True" ForeColor="White" />
                                                                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                                                <RowStyle ForeColor="#000066" BackColor="#E9EFD9" />
                                                                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                                                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                                                <SortedAscendingHeaderStyle BackColor="#007DBB" />
                                                                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                                                <SortedDescendingHeaderStyle BackColor="#00547E" />
                                                                <Columns>
                                                                    <asp:BoundField DataField="Pos" HeaderText="Nº" />
                                                                    <asp:BoundField DataField="FechaCreacion" HeaderText="Fecha creación" HtmlEncode="False"
                                                                        ItemStyle-Font-Size="Smaller" />
                                                                    <asp:BoundField DataField="TipAnoNro" HeaderText="Tipo/Año/Nro" HtmlEncode="False"
                                                                        ItemStyle-Font-Size="Smaller" />
                                                                    <asp:BoundField DataField="Asunto" HeaderText="Asunto" ItemStyle-HorizontalAlign="Left"
                                                                        ItemStyle-Font-Size="Smaller" />
                                                                    <asp:BoundField DataField="Derivado" HeaderText="Estado" ItemStyle-Font-Size="Smaller" />
                                                                    <asp:ButtonField ButtonType="Image" ImageUrl="Imagenes/ver.png" CommandName="VerImagen"
                                                                        ItemStyle-CssClass="tdBotonImage" Visible="false" ControlStyle-Width="20px" ControlStyle-Height="20px"/>
                                                                    <asp:TemplateField>
                                                                        <ItemTemplate>
                                                                            <a href="frmImgDocumento.aspx?id=<%# Eval("IdDocumentos") %>" target="_blank">
                                                                                <img src="Imagenes/ver.png" alt="Ver" class="tdBotonImage"  style="width:20px;height:20px;"/></a>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField>
                                                                        <ItemTemplate>
                                                                            </td></tr>
                                                                            <tr>
                                                                                <td colspan="100%">
                                                                                    <div id="div<%# Eval("IdDocumentos") %>" style="position: relative; left: 25px;">
                                                                                        <asp:GridView runat="server" ID="gvRespuesta" Width="95%" AutoGenerateColumns="false"
                                                                                            DataKeyNames="IdDocumentos" EmptyDataText="">
                                                                                            <FooterStyle BackColor="White" ForeColor="#000066" />
                                                                                            <HeaderStyle BackColor="#bcc7d8" Font-Bold="True" ForeColor="White" Font-Size="Smaller" />
                                                                                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                                                                            <RowStyle ForeColor="#000066" BackColor="#DEE1E7" />
                                                                                            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                                                                            <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                                                                            <SortedAscendingHeaderStyle BackColor="#007DBB" />
                                                                                            <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                                                                            <SortedDescendingHeaderStyle BackColor="#00547E" />
                                                                                            <Columns>
                                                                                                <asp:BoundField DataField="RespNro" HeaderText="Rpta. a: Nro. de doc:" ItemStyle-Font-Size="Smaller" />
                                                                                                <asp:BoundField DataField="FechaDoc" HeaderText="Fecha doc." ItemStyle-Font-Size="Smaller" />
                                                                                                <asp:BoundField DataField="AsuntoDoc" HeaderText="Asunto" ItemStyle-Font-Size="Smaller"
                                                                                                    ItemStyle-HorizontalAlign="Left" />
                                                                                                <asp:BoundField DataField="Tarea" HeaderText="Tarea" ItemStyle-Font-Size="Smaller" />
                                                                                                <asp:TemplateField>
                                                                                                    <ItemTemplate>
                                                                                                        <a href="frmImgDocumento.aspx?id=<%# Eval("IdDocuRespuesta") %>" target="_blank">
                                                                                                            <img src="Imagenes/ver.png" alt="Ver" style="width:20px;height:20px;" /></a>
                                                                                                    </ItemTemplate>
                                                                                                </asp:TemplateField>
                                                                                            </Columns>
                                                                                        </asp:GridView>
                                                                                    </div>
                                                                                </td>
                                                                            </tr>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                </Columns>
                                                            </asp:GridView>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
